package org.dr.springmvcdemo.thymeleaf;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class DemoController {
    // create a mapping for "/hello"
    @GetMapping("/hello")
    public String sayHello(Model model) {
        //view层可以直接调用model中被添加的date属性
        model.addAttribute("date", java.time.LocalDateTime.now());

        return "helloworld";
    }
}
